package com.accloud.cloudservice;

import com.accloud.common.ACConfiguration;
import com.accloud.service.ACAccountMgr;
import com.accloud.service.ACContext;
import com.accloud.service.ACException;
import com.accloud.service.ACFileInfo;
import com.accloud.service.ACMsg;
import com.accloud.service.ACObject;
import com.accloud.service.ACOpenIdInfo;
import com.accloud.service.ACThirdPlatform;
import com.accloud.service.ACUserInfo;
import com.accloud.utils.LogUtil;
import com.accloud.utils.PreferencesUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.TimeZone;
import java.util.UUID;
import org.json.JSONException;

public class ACAccountManager extends ACBaseManager implements ACAccountMgr {
    public static final int ERR_EXPIRED_REFRESH_TOKEN = 3516;
    public static final int ERR_INVALID_REFRESH_TOKEN = 3514;
    public static final int ERR_INVALID_SIGNATURE = 3015;
    private static final String TAG = ACAccountManager.class.getSimpleName();
    public static BaseCallback callback;

    public ACAccountManager() {
        super(ACConfiguration.ACCOUNT_SERVICE_NAME, 1, true);
    }

    @Override // com.accloud.service.ACAccountMgr
    public void sendVerifyCode(String account, int template, VoidCallback callback2) {
        ACMsg req = new ACMsg();
        req.setContext(new ACContext(AC.majorDomain, false));
        req.setName("sendVerifyCode");
        req.put("account", account);
        req.put("template", Integer.valueOf(template));
        sendReq(req, callback2);
    }

    @Override // com.accloud.service.ACAccountMgr
    public void checkVerifyCode(String account, String verifyCode, final PayloadCallback<Boolean> callback2) {
        ACMsg req = new ACMsg();
        req.setContext(new ACContext(AC.majorDomain, false));
        req.setName("checkVerifyCode");
        req.put("account", account);
        req.put("verifyCode", verifyCode);
        sendReq(req, callback2, new ACMsgListener() {
            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass1 */

            @Override // com.accloud.cloudservice.ACMsgListener
            public void finish(ACMsg resp) {
                callback2.success(Boolean.valueOf(resp.getBoolean("valid")));
            }
        });
    }

    @Override // com.accloud.service.ACAccountMgr
    public void register(String email, String phone, String password, String name, String verifyCode, PayloadCallback<ACUserInfo> callback2) {
        if (((email == null || email.length() <= 0) && (phone == null || phone.length() <= 0)) || password.length() <= 0 || verifyCode.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
            return;
        }
        ACMsg req = new ACMsg();
        ACContext context = new ACContext(AC.majorDomain, false);
        context.setMethodVersion(1L);
        req.setContext(context);
        req.setName("register");
        if (email != null) {
            req.put("email", email);
        }
        if (phone != null) {
            req.put("phone", phone);
        }
        if (name != null && name.length() > 0) {
            req.put("nickName", name);
        }
        req.put("verifyCode", verifyCode);
        req.put("password", password);
        sendReq(req, callback2, new UserInfoCallback(callback2));
    }

    @Override // com.accloud.service.ACAccountMgr
    public void checkExist(String account, final PayloadCallback<Boolean> callback2) {
        if (account.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
            return;
        }
        ACMsg req = new ACMsg();
        req.setContext(new ACContext(AC.majorDomain, false));
        req.setName("checkExist");
        req.put("account", account);
        sendReq(req, callback2, new ACMsgListener() {
            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass2 */

            @Override // com.accloud.cloudservice.ACMsgListener
            public void finish(ACMsg resp) {
                callback2.success(Boolean.valueOf(resp.getBoolean("exist")));
            }
        });
    }

    @Override // com.accloud.service.ACAccountMgr
    public void login(String account, String password, PayloadCallback<ACUserInfo> callback2) {
        PayloadEventCallback<ACUserInfo> callbackWrapper = new PayloadEventCallback<>(new LoginEvent(account, "ac"), callback2);
        if (account.length() <= 0 || password.length() <= 0) {
            callbackWrapper.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
            return;
        }
        ACMsg req = new ACMsg();
        ACContext context = new ACContext(AC.majorDomain, false);
        context.setMethodVersion(1L);
        req.setContext(context);
        req.setName("login");
        req.put("account", account);
        req.put("password", password);
        sendReq(req, callbackWrapper, new UserInfoCallback(callbackWrapper));
    }

    @Override // com.accloud.service.ACAccountMgr
    public void loginWithVerifyCode(String account, String verifyCode, PayloadCallback<ACUserInfo> callback2) {
        PayloadEventCallback<ACUserInfo> callbackWrapper = new PayloadEventCallback<>(new LoginEvent(account, "ac"), callback2);
        if (account.length() <= 0 || verifyCode.length() <= 0) {
            callbackWrapper.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
            return;
        }
        ACMsg req = new ACMsg();
        ACContext context = new ACContext(AC.majorDomain, false);
        context.setMethodVersion(1L);
        req.setContext(context);
        req.setName("loginWithVerifyCode");
        req.put("account", account);
        req.put("verifyCode", verifyCode);
        sendReq(req, callbackWrapper, new UserInfoCallback(callbackWrapper));
    }

    @Override // com.accloud.service.ACAccountMgr
    public void updateAccessToken() throws ACException {
        ACMsg req = new ACMsg();
        ACContext context = new ACContext(AC.majorDomain, true);
        context.setMethodVersion(1L);
        req.setContext(context);
        req.setName("updateAccessToken");
        ACMsg resp = new ACServiceSyncClient(ACConfiguration.ACCOUNT_SERVICE_NAME, 1, ACConfiguration.getHttpsRouterAddr(), req).postData();
        if (!resp.isErr()) {
            String token = resp.getString("token");
            String tokenExpire = resp.getString("tokenExpire");
            String refreshTokenExpire = resp.getString("refreshTokenExpire");
            PreferencesUtils.putString(AC.context, ACConfiguration.KEY_TOKEN, token);
            try {
                PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_TOKEN_EXPIRE, getDateFormat().parse(tokenExpire).getTime());
                PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_REFRESH_TOKEN_EXPIRE, getDateFormat().parse(refreshTokenExpire).getTime());
            } catch (ParseException e) {
            }
        } else if (resp.getErrCode().intValue() == 3015 || resp.getErrCode().intValue() == 3514 || resp.getErrCode().intValue() == 3516) {
            ACException exception = new ACException(resp.getErrCode().intValue(), resp.getErrMsg(), "Invalid refresh token: " + PreferencesUtils.getString(AC.context, ACConfiguration.KEY_REFRESH_TOKEN));
            if (callback != null) {
                callback.error(exception);
            }
            throw exception;
        } else {
            throw new ACException(resp.getErrCode().intValue(), resp.getErrMsg());
        }
    }

    @Override // com.accloud.service.ACAccountMgr
    public void forceUpdateRefreshToken(PayloadCallback<ACUserInfo> callback2) {
        if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
            return;
        }
        ACMsg req = ACMsg.getACMsg(null);
        req.setName("forceUpdateRefreshToken");
        sendReq(req, callback2, new UserInfoCallback(callback2));
    }

    @Override // com.accloud.service.ACAccountMgr
    public void loginWithOpenId(ACThirdPlatform thirdPlatform, String openId, String accessToken, PayloadCallback<ACUserInfo> callback2) {
        PayloadEventCallback<ACUserInfo> callbackWrapper = new PayloadEventCallback<>(new LoginEvent(openId, thirdPlatform.provider), callback2);
        if (openId.length() <= 0 || accessToken.length() <= 0) {
            callbackWrapper.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
            return;
        }
        ACMsg req = new ACMsg();
        ACContext context = new ACContext(AC.majorDomain, false);
        context.setMethodVersion(1L);
        req.setContext(context);
        req.setName("loginWithOpenId");
        req.put("provider", thirdPlatform.provider);
        req.put("openId", openId);
        req.put("accessToken", accessToken);
        sendReq(req, callbackWrapper, new UserInfoCallback(callbackWrapper));
    }

    @Override // com.accloud.service.ACAccountMgr
    public void bindWithOpenId(ACThirdPlatform thirdPlatform, String openId, String accessToken, VoidCallback callback2) {
        if (openId.length() <= 0 || accessToken.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
        } else if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
        } else {
            ACMsg req = ACMsg.getACMsg("");
            req.setName("bindWithOpenId");
            req.put("provider", thirdPlatform.provider);
            req.put("openId", openId);
            req.put("accessToken", accessToken);
            sendReq(req, callback2);
        }
    }

    @Override // com.accloud.service.ACAccountMgr
    public void bindWithAccount(String email, String phone, String password, String nickName, String verifyCode, VoidCallback callback2) {
        if (((email == null || email.length() <= 0) && (phone == null || phone.length() <= 0)) || password.length() <= 0 || verifyCode.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
        } else if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
        } else {
            ACMsg req = ACMsg.getACMsg("");
            req.setName("bindWithAccount");
            if (email != null) {
                req.put("email", email);
            }
            if (phone != null) {
                req.put("phone", phone);
            }
            req.put("password", password);
            req.put("nickName", nickName);
            req.put("verifyCode", verifyCode);
            sendReq(req, callback2);
        }
    }

    @Override // com.accloud.service.ACAccountMgr
    public void listAllOpenIds(final PayloadCallback<List<ACOpenIdInfo>> callback2) {
        if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
            return;
        }
        ACMsg req = ACMsg.getACMsg("");
        req.setName("listAllOpenIds");
        sendReq(req, callback2, new ACMsgListener() {
            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass3 */

            @Override // com.accloud.cloudservice.ACMsgListener
            public void finish(ACMsg resp) {
                List<ACObject> objectList = resp.getList("openIds");
                ArrayList arrayList = new ArrayList();
                for (ACObject object : objectList) {
                    String openId = object.getString("openId");
                    String provider = object.getString("provider");
                    if (provider.equals(ACThirdPlatform.QQ.provider)) {
                        arrayList.add(new ACOpenIdInfo(ACThirdPlatform.QQ, openId));
                    } else if (provider.equals(ACThirdPlatform.SINA.provider)) {
                        arrayList.add(new ACOpenIdInfo(ACThirdPlatform.SINA, openId));
                    } else if (provider.equals(ACThirdPlatform.WEIXIN.provider)) {
                        arrayList.add(new ACOpenIdInfo(ACThirdPlatform.WEIXIN, openId));
                    } else if (provider.equals(ACThirdPlatform.JINGDONG.provider)) {
                        arrayList.add(new ACOpenIdInfo(ACThirdPlatform.JINGDONG, openId));
                    } else {
                        ACThirdPlatform.OTHER.setProvider(provider);
                        arrayList.add(new ACOpenIdInfo(ACThirdPlatform.OTHER, openId));
                    }
                }
                callback2.success(arrayList);
            }
        });
    }

    @Override // com.accloud.service.ACAccountMgr
    public void changePhone(String phone, String password, String verifyCode, VoidCallback callback2) {
        if (phone.length() <= 0 || password.length() <= 0 || verifyCode.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
        } else if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
        } else {
            ACMsg req = ACMsg.getACMsg("");
            req.setName("changePhone");
            req.put("phone", phone);
            req.put("password", password);
            req.put("verifyCode", verifyCode);
            sendReq(req, callback2);
        }
    }

    @Override // com.accloud.service.ACAccountMgr
    public void changeEmail(String email, String password, String verifyCode, VoidCallback callback2) {
        if (email.length() <= 0 || password.length() <= 0 || verifyCode.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
        } else if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
        } else {
            ACMsg req = ACMsg.getACMsg("");
            req.setName("changeEmail");
            req.put("email", email);
            req.put("password", password);
            req.put("verifyCode", verifyCode);
            sendReq(req, callback2);
        }
    }

    @Override // com.accloud.service.ACAccountMgr
    public void changeNickName(String nickName, VoidCallback callback2) {
        if (nickName.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
        } else if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
        } else {
            ACMsg req = ACMsg.getACMsg("");
            req.setName("changeNickName");
            req.put("nickName", nickName);
            sendReq(req, callback2);
        }
    }

    @Override // com.accloud.service.ACAccountMgr
    public void changePassword(String oldPswd, String newPswd, final VoidCallback callback2) {
        if (oldPswd.length() <= 0 || newPswd.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
        } else if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
        } else {
            ACMsg req = new ACMsg();
            ACContext context = new ACContext(AC.majorDomain, "", PreferencesUtils.getLong(AC.context, ACConfiguration.KEY_USERID, 0));
            context.setMethodVersion(1L);
            req.setContext(context);
            req.setName("changePassword");
            req.put("old", oldPswd);
            req.put("new", newPswd);
            sendReq(req, callback2, new ACMsgListener() {
                /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass4 */

                @Override // com.accloud.cloudservice.ACMsgListener
                public void finish(ACMsg resp) {
                    long userId = resp.getLong("userId");
                    String token = resp.getString("token");
                    String tokenExpire = resp.getString("tokenExpire");
                    String refreshToken = resp.getString("refreshToken");
                    String refreshTokenExpire = resp.getString("refreshTokenExpire");
                    PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_USERID, userId);
                    PreferencesUtils.putString(AC.context, ACConfiguration.KEY_TOKEN, token);
                    PreferencesUtils.putString(AC.context, ACConfiguration.KEY_REFRESH_TOKEN, refreshToken);
                    try {
                        PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_TOKEN_EXPIRE, ACAccountManager.getDateFormat().parse(tokenExpire).getTime());
                        PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_REFRESH_TOKEN_EXPIRE, ACAccountManager.getDateFormat().parse(refreshTokenExpire).getTime());
                    } catch (ParseException e) {
                    }
                    callback2.success();
                }
            });
        }
    }

    @Override // com.accloud.service.ACAccountMgr
    public void resetPassword(String account, String pwd, String verifyCode, PayloadCallback<ACUserInfo> callback2) {
        if (account.length() <= 0 || pwd.length() <= 0) {
            callback2.error(new ACException(ACException.INVALID_PARAMETERS, "invalid parameters"));
            return;
        }
        ACMsg req = new ACMsg();
        ACContext context = new ACContext(AC.majorDomain, false);
        context.setMethodVersion(1L);
        req.setContext(context);
        req.setName("resetPassword");
        req.put("account", account);
        req.put("password", pwd);
        req.put("verifyCode", verifyCode);
        sendReq(req, callback2, new UserInfoCallback(callback2));
    }

    @Override // com.accloud.service.ACAccountMgr
    public void setAvatar(byte[] data, final VoidCallback callback2) {
        final ACFileInfo fileInfo = new ACFileInfo(true, "avatar", UUID.randomUUID().toString());
        fileInfo.setData(data);
        AC.fileMgr().uploadFile(fileInfo, null, new VoidCallback() {
            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass5 */

            @Override // com.accloud.cloudservice.VoidCallback
            public void success() {
                AC.fileMgr().getDownloadUrl(fileInfo, 0, new PayloadCallback<String>() {
                    /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass5.AnonymousClass1 */

                    public void success(String url) {
                        ACObject profile = new ACObject();
                        profile.put("_avatar", url);
                        ACAccountManager.this.setUserProfile(profile, callback2);
                    }

                    @Override // com.accloud.cloudservice.BaseCallback
                    public void error(ACException e) {
                        callback2.error(e);
                    }
                });
            }

            @Override // com.accloud.cloudservice.BaseCallback
            public void error(ACException e) {
                callback2.error(e);
            }
        });
    }

    @Override // com.accloud.service.ACAccountMgr
    public void setAvatar(byte[] data, final PayloadCallback<String> callback2) {
        final ACFileInfo fileInfo = new ACFileInfo(true, "avatar", UUID.randomUUID().toString());
        fileInfo.setData(data);
        AC.fileMgr().uploadFile(fileInfo, null, new VoidCallback() {
            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass6 */

            @Override // com.accloud.cloudservice.VoidCallback
            public void success() {
                AC.fileMgr().getDownloadUrl(fileInfo, 0, new PayloadCallback<String>() {
                    /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass6.AnonymousClass1 */

                    public void success(final String url) {
                        ACObject profile = new ACObject();
                        profile.put("_avatar", url);
                        ACMsg req = ACMsg.getACMsg("");
                        req.setName("setUserProfile");
                        req.put("userProfile", profile);
                        ACAccountManager.this.sendReq(req, callback2, new ACMsgListener() {
                            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass6.AnonymousClass1.AnonymousClass1 */

                            @Override // com.accloud.cloudservice.ACMsgListener
                            public void finish(ACMsg resp) {
                                callback2.success(url);
                            }
                        });
                    }

                    @Override // com.accloud.cloudservice.BaseCallback
                    public void error(ACException e) {
                        callback2.error(e);
                    }
                });
            }

            @Override // com.accloud.cloudservice.BaseCallback
            public void error(ACException e) {
                callback2.error(e);
            }
        });
    }

    @Override // com.accloud.service.ACAccountMgr
    public void getPublicProfiles(List<Long> userList, final PayloadCallback<List<ACObject>> callback2) {
        if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
            return;
        }
        ACMsg req = ACMsg.getACMsg("");
        req.setName("getPublicProfilesByUserList");
        req.put("userList", userList);
        sendReq(req, callback2, new ACMsgListener() {
            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass7 */

            @Override // com.accloud.cloudservice.ACMsgListener
            public void finish(ACMsg resp) {
                callback2.success((List) resp.get("profiles"));
            }
        });
    }

    @Override // com.accloud.service.ACAccountMgr
    public void setUserProfile(ACObject userProfile, VoidCallback callback2) {
        if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
            return;
        }
        ACMsg req = ACMsg.getACMsg("");
        req.setName("setUserProfile");
        req.put("userProfile", userProfile);
        sendReq(req, callback2);
    }

    @Override // com.accloud.service.ACAccountMgr
    public void getUserProfile(final PayloadCallback<ACObject> callback2) {
        if (!isLogin()) {
            callback2.error(new ACException(ACException.NO_LOGIN, "no login"));
            return;
        }
        ACMsg req = ACMsg.getACMsg("");
        req.setName("getUserProfile");
        sendReq(req, callback2, new ACMsgListener() {
            /* class com.accloud.cloudservice.ACAccountManager.AnonymousClass8 */

            @Override // com.accloud.cloudservice.ACMsgListener
            public void finish(ACMsg resp) {
                callback2.success(resp.getACObject("userProfile"));
            }
        });
    }

    @Override // com.accloud.service.ACAccountMgr
    public long getUserId() {
        return PreferencesUtils.getLong(AC.context, ACConfiguration.KEY_USERID, 0);
    }

    @Override // com.accloud.service.ACAccountMgr
    public boolean isLogin() {
        long refreshTokenExpire = PreferencesUtils.getLong(AC.context, ACConfiguration.KEY_REFRESH_TOKEN_EXPIRE, 0);
        return PreferencesUtils.getLong(AC.context, ACConfiguration.KEY_USERID, -1) > 0 && (refreshTokenExpire == 0 || refreshTokenExpire > System.currentTimeMillis() + 5000);
    }

    @Override // com.accloud.service.ACAccountMgr
    public void logout() {
        PreferencesUtils.removeKey(AC.context, ACConfiguration.KEY_USERID);
        PreferencesUtils.removeKey(AC.context, ACConfiguration.KEY_TOKEN);
        PreferencesUtils.removeKey(AC.context, ACConfiguration.KEY_TOKEN_EXPIRE);
        PreferencesUtils.removeKey(AC.context, ACConfiguration.KEY_REFRESH_TOKEN);
        PreferencesUtils.removeKey(AC.context, ACConfiguration.KEY_REFRESH_TOKEN_EXPIRE);
        PreferencesUtils.removeKey(AC.context, "ablecloud_privatedevices_num");
        AC.pushMgr().disconnect();
    }

    @Override // com.accloud.service.ACAccountMgr
    public void setRefreshTokenInvalidCallback(BaseCallback callback2) {
        callback = callback2;
    }

    /* access modifiers changed from: private */
    public static SimpleDateFormat getDateFormat() {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        format.setTimeZone(TimeZone.getTimeZone("UTC"));
        return format;
    }

    private class LoginEvent extends ACEvent {
        private LoginEvent(String account, String accountType) {
            super("apm_app_user_manage", "login", null);
            try {
                this.data.put("account", account);
                this.data.put("account_type", accountType);
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }

    private static class UserInfoCallback implements ACMsgListener {
        private final PayloadCallback<ACUserInfo> callback;

        public UserInfoCallback(PayloadCallback<ACUserInfo> callback2) {
            this.callback = callback2;
        }

        @Override // com.accloud.cloudservice.ACMsgListener
        public void finish(ACMsg resp) {
            long uid = resp.getLong("userId");
            String token = resp.getString("token");
            String tokenExpire = resp.getString("tokenExpire");
            String refreshToken = resp.getString("refreshToken");
            String refreshTokenExpire = resp.getString("refreshTokenExpire");
            String phone = resp.getString("phone");
            String email = resp.getString("email");
            String name = resp.getString("nickName");
            PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_USERID, uid);
            PreferencesUtils.putString(AC.context, ACConfiguration.KEY_TOKEN, token);
            PreferencesUtils.putString(AC.context, ACConfiguration.KEY_REFRESH_TOKEN, refreshToken);
            try {
                PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_TOKEN_EXPIRE, ACAccountManager.getDateFormat().parse(tokenExpire).getTime());
                PreferencesUtils.putLong(AC.context, ACConfiguration.KEY_REFRESH_TOKEN_EXPIRE, ACAccountManager.getDateFormat().parse(refreshTokenExpire).getTime());
            } catch (ParseException e) {
            }
            ACUserInfo userInfo = new ACUserInfo(uid, phone, email, name);
            ACObject userProfile = resp.getACObject("userProfile");
            userInfo.setProfile(userProfile);
            if (userProfile != null) {
                userInfo.setAvatar(userProfile.getString("_avatar"));
            }
            this.callback.success(userInfo);
        }
    }
}
